package cn.edu.shengda;


interface ShapeArea {
    abstract double getArea();
    abstract double getPerimeter();
}

class Rectangle implements ShapeArea {
    double width;
    double height;
    public Rectangle(double w, double h) {
        this.width = w;
        this.height = h;
    }
    public double getPerimeter() {
        return 2 * (width + height);
    }
    public double getArea() {
        return height * width;
    }
}

class Circle implements ShapeArea {
    double radius;
    Circle(double r) {
        radius = r;
    }
    public double getArea() {
        return Math.acos(-1) * radius * radius;
    }
    public double getPerimeter() {
        return 2 * Math.acos(-1) * radius;
    }
}